#include <iostream>
#include <algorithm>

using namespace std;

typedef unsigned long long ULL;

const int N =  1e7 + 10, P = 131;
ULL f[N], p[N];
int n;

void init_hash(string& s)
{
	f[0] = 0; p[0] = 1;
	for(int i = 1; i <= s.size(); i++)
	{
		f[i] = f[i - 1] * P + s[i - 1];
		p[i] = p[i - 1] * P;
	}
}

ULL get_hash(int l, int r)
{
	return f[r] - f[l - 1] * p[r - l + 1];
}

int main()
{
	string s; cin >> s;
	cin >> n;
	init_hash(s);
	for(int i = 1; i <= n; i++)
	{
		int l1, r1, l2, r2; cin >> l1 >> r1 >> l2 >> r2;
		ULL x = get_hash(l1, r1);
		ULL y = get_hash(l2, r2);
		if(x == y) cout << "Yes" << endl;
		else cout << "No" << endl; 
	}
	return 0;
}
